<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(name,age){
            this.name=name;
            this.age=age;
            this.hobby=function(){
                console.log(this.name+"爱旅游");
                
            }
        }
       
        var pubasen= new Person("普巴森",4)
        var  miqi =new Person("米奇",2)
        console.log(pubasen);
        console.log(miqi);
        pubasen.hobby();
        
    </script>
</body>
</html>
